package com.greatchn.authorization_server.web.po;

import javax.persistence.*;
import java.io.Serializable;
import java.sql.Timestamp;
import java.util.Objects;

/**
 * @OauthFunctionInfo:
 * @author: ZBoHang
 * @time: 2023/2/28 9:07
 */
@Entity
@Table(name = "oauth_function_info", schema = "sso", catalog = "")
public class OauthFunctionInfo implements Serializable {
    private static final long serialVersionUID = 6981162969486304865L;
    private Integer functionId;
    private String functionName;
    private String desc;
    private String state;
    private Timestamp createTime;

    @Id
    @Column(name = "function_id", nullable = false)
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    public Integer getFunctionId() {
        return functionId;
    }

    public void setFunctionId(Integer functionId) {
        this.functionId = functionId;
    }

    @Basic
    @Column(name = "function_name", nullable = true, length = 255)
    public String getFunctionName() {
        return functionName;
    }

    public void setFunctionName(String functionName) {
        this.functionName = functionName;
    }

    @Basic
    @Column(name = "desc", nullable = true, length = 255)
    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    @Basic
    @Column(name = "state", nullable = true, length = 1)
    public String getState() {
        return state;
    }

    public void setState(String state) {
        this.state = state;
    }

    @Basic
    @Column(name = "create_time", nullable = true)
    public Timestamp getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Timestamp createTime) {
        this.createTime = createTime;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        OauthFunctionInfo that = (OauthFunctionInfo) o;
        return Objects.equals(functionId, that.functionId) && Objects.equals(functionName, that.functionName) && Objects.equals(desc, that.desc) && Objects.equals(state, that.state) && Objects.equals(createTime, that.createTime);
    }

    @Override
    public int hashCode() {
        return Objects.hash(functionId, functionName, desc, state, createTime);
    }
}
